<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>SCB First to Enjoy</title>
	<link rel="stylesheet" href="css/global.css" media="all" />
	<link rel="stylesheet" href="css/style.css" media="all" />
	<script src="js/jquery.min.js"></script>
    </head>
    <body>
	<div id="fb-root"></div>
	<script type="text/javascript">
	    window.fbAsyncInit = function() {
		FB.init({
		    appId: '{$fb_app_id}',
		    status: true,
		    cookie: true,
		    xfbml: true
		});
		FB.Canvas.setSize({width: 810, height: 834});
	    };
	    (function() {
		var e = document.createElement('script'); e.async = true;
		e.src = document.location.protocol +
		'//connect.facebook.net/en_US/all.js';
		document.getElementById('fb-root').appendChild(e);
	    }());
	</script>
	
	<div id="wrapper" class="wrapper-form-v2">
	    
	    <form id="form-info">
		<div id="form-credit">
		    <input type="text" class="credit" name="credit-f" id="credit-f" maxlength="4" size="4" />
		    <input type="text" class="credit" name="credit-s" id="credit-s" maxlength="2" size="2" />
		    <input type="text" class="credit" name="credit-t" id="credit-t" maxlength="4" size="4" />
		    <div class="clear">&nbsp;</div>
		    <input type="hidden" name="credit" />
		</div>
		
		<div id="form-id">
		    <input type="text" class="personal-id" name="id-f" id="id-f" maxlength="1" size="1" />
		    <input type="text" class="personal-id" name="id-s" id="id-s" maxlength="4" size="4" />
		    <input type="text" class="personal-id" name="id-t" id="id-t" maxlength="5" size="5" />
		    <input type="text" class="personal-id" name="id-4" id="id-4" maxlength="2" size="2" />
		    <input type="text" class="personal-id" name="id-5" id="id-5" maxlength="1" size="1" />
		    <div class="clear">&nbsp;</div>
		    <input type="hidden" name="name" />
		</div>
		
		<div id="form-tel">
		    <input type="text" class="tel" name="tel-f" id="tel-f" maxlength="3" size="3" />
		    <input type="text" class="tel" name="tel-s" id="tel-s" maxlength="3" size="3" />
		    <input type="text" class="tel" name="tel-t" id="tel-t" maxlength="4" size="4" />
		    <div class="clear">&nbsp;</div>
		    <input type="hidden" name="tel" />
		</div>
	    </form>
	    
            <a href="javascript:void(0);" title="Next" id="form-bt">&nbsp;</a>
	    
	    <div class="hidden">
		<script type="text/javascript" src="js/fancybox/jquery.fancybox.pack.js"></script>
		<link rel="stylesheet" href="js/fancybox/jquery.fancybox.css" media="all" />
		<script type="text/javascript" src="js/jquery.autotab-1.1b.js"></script>
		<script type="text/javascript">
		    $(document).ready(function() {
			$('.acolorbox').fancybox({
			    'closeBtn':false,
			    'autoDimensions' : false,
			    'autoScale' : false,
			    'closeClick' : false,
			    'helpers' :  {
				overlay : {
				    closeClick: false
				}
			    }
			});
			
			$('.light-box-close-bt').live('click',function(){
			   $.fancybox.close();
			});
			
			$('.tel').autotab_magic().autotab_filter('numeric');
			$('.credit').autotab_magic().autotab_filter('numeric');
			$('.personal-id').autotab_magic().autotab_filter('numeric');
			
			$('#form-bt').live('click',function(){
			    $('#ajax-loader').click();
			    
			    $.post('{$site_url}form-check', $("#form-info").serialize(), function(data){
				if(data.status){
				    $("#form-info").attr('method','post');
				    $("#form-info").attr('action','{$site_url}prizes.html');
				    $("input[name='name']").val(data.name);
				    $("input[name='tel']").val(data.tel);
				    $("input[name='credit']").val(data.credit);
				    $("#form-info").submit();
				}else{
				    $('#form-error-msg').html(data.error);
				    $('#form-error-box').click();
				}
			    },'json');
			});
		    });
		</script>
				
		<a href="#ajax-loader-block" id="ajax-loader" class="acolorbox">Please wait...</a>
		<div id="ajax-loader-block" style="padding:15px 10px 5px 10px;background:#000000;text-align:center;-webkit-border-radius: 10px;-moz-border-radius: 10px;border-radius: 10px;opacity: 0.7;color: #cccccc;">
		    <img src="images/284.gif" alt="Please wait..." style="width:60px;" />
		    <p>Please wait...</p>
		</div>
		
		<!-- light box : form error -->
		<a href="#form-error" class="acolorbox" id="form-error-box">Click!!</a>
		<div id="form-error">
		    <img src="images/close-bt.png" class="light-box-close-bt" alt="close" />
		    
		    <div id="form-error-msg"></div>
		</div>
		<!-- light box : form end -->
	    </div>
        </div>
    </body>
</html>